package com.ruoyi.supplier.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supplier.mapper.TbBankIncomeMapper;
import com.ruoyi.supplier.domain.TbBankIncome;
import com.ruoyi.supplier.service.ITbBankIncomeService;

/**
 * 进账类别Service业务层处理
 * 
 * @author oliver.li
 * @date 2021-08-14
 */
@Service
public class TbBankIncomeServiceImpl implements ITbBankIncomeService 
{
    @Autowired
    private TbBankIncomeMapper tbBankIncomeMapper;

    /**
     * 查询进账类别
     * 
     * @param id 进账类别ID
     * @return 进账类别
     */
    @Override
    public TbBankIncome selectTbBankIncomeById(Long id)
    {
        return tbBankIncomeMapper.selectTbBankIncomeById(id);
    }

    /**
     * 查询进账类别列表
     * 
     * @param tbBankIncome 进账类别
     * @return 进账类别
     */
    @Override
    public List<TbBankIncome> selectTbBankIncomeList(TbBankIncome tbBankIncome)
    {
        return tbBankIncomeMapper.selectTbBankIncomeList(tbBankIncome);
    }

    /**
     * 新增进账类别
     * 
     * @param tbBankIncome 进账类别
     * @return 结果
     */
    @Override
    public int insertTbBankIncome(TbBankIncome tbBankIncome)
    {
        tbBankIncome.setCreateTime(DateUtils.getNowDate());
        return tbBankIncomeMapper.insertTbBankIncome(tbBankIncome);
    }

    /**
     * 修改进账类别
     * 
     * @param tbBankIncome 进账类别
     * @return 结果
     */
    @Override
    public int updateTbBankIncome(TbBankIncome tbBankIncome)
    {
        tbBankIncome.setUpdateTime(DateUtils.getNowDate());
        return tbBankIncomeMapper.updateTbBankIncome(tbBankIncome);
    }

    /**
     * 批量删除进账类别
     * 
     * @param ids 需要删除的进账类别ID
     * @return 结果
     */
    @Override
    public int deleteTbBankIncomeByIds(Long[] ids)
    {
        return tbBankIncomeMapper.deleteTbBankIncomeByIds(ids);
    }

    /**
     * 删除进账类别信息
     * 
     * @param id 进账类别ID
     * @return 结果
     */
    @Override
    public int deleteTbBankIncomeById(Long id)
    {
        return tbBankIncomeMapper.deleteTbBankIncomeById(id);
    }
}
